expt_orig_file = File.open "expt_file.txt","r" #检验数据原始文件
expt_head_file = File.open "expt_file.h","w"

expt_head_file_content = "#ifndef EXPT_FILE_H_\n#define EXPT_FILE_H_\n"
expt_head_file_content += "#include \"mock_def.h\"\n" #生成检验数据头文件
expt_head_file_content += "float32_t expt_datas[750] = {"

expt_orig_file.each do |line|
    expt_head_file_content += "#{line.chop!}, "
end

expt_head_file_content.chop!
expt_head_file_content += "};\n#endif \\* EXPT_FILE_H_ *\\"
expt_head_file.write expt_head_file_content

puts expt_head_file_content
expt_orig_file.close
expt_head_file.close